#ifndef _MPZ_SMOOTHSCAN_INCLUDE_
#define _MPZ_SMOOTHSCAN_INCLUDE_

/*
    Copyright 2009-2010 Andrew V. Sutherland

    This file is part of "smoothrelation".

    smoothrelation is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    smoothrelation is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with smoothrelation.  If not, see <http://www.gnu.org/licenses/>.
*/

// Given n integers a[i], computes o = \prod a[i], destroying a[] in the process.
void mpz_mul_set (mpz_t o, mpz_t a[], int n);

/*
	Given n integers a[i] each bounded by 2^{2^e}, finds the first
	integer in the list that is composed entirely of primes dividing P,
	or returns n if none are.  Uses Bernstein's algorithm.
	
	NOTE: The list size n must be a power of 2 and the parameter
	t should point to a preallocated list 2n entries.
        This function does not dynamically allocate any memory.

*/
int mpz_smoothscan (mpz_t *a, int n, int e, mpz_t P, mpz_t *t);

#endif
